package hk.ust.comp3111.ustnutrition.data.db;

import java.util.Map;

import hk.ust.comp3111.ustnutrition.data.DataRow;
import hk.ust.comp3111.ustnutrition.data.DataTableName;

@DataTableName(value="restaurants",canWrite=false)
public class Restaurant extends DataRow
{
	public Restaurant()
	{
	}
	
	public Restaurant(String name, String address)
	{
		mName = name;
		mAddress = address;
	}
	
	String mName;
	String mAddress;
	
	public String getName() {
		return mName;
	}
	
	public String getAddress() {
		return mAddress;
	}
	
	public String toString()
	{
		return mName;
	}
	
	@Override
	public void loadInfo(Map<String, Object> obj) {
		super.loadInfo(obj);
		mName = (String) obj.get("name");
		mAddress = (String) obj.get("address");
	}
	
	@Override
	public void putInfo(Map<String, Object> obj) {
		super.putInfo(obj);
		obj.put("name", mName);
		obj.put("address", mAddress);
	}
}
